package com.exchange.Public;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import com.exchange.View.a.c;
import java.security.MessageDigest;
import java.text.DecimalFormat;
import javax.microedition.khronos.opengles.GL10;

public class m
{
  // ERROR //
  public static String a()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_0
    //   2: new 16	java/io/FileReader
    //   5: dup
    //   6: ldc 18
    //   8: invokespecial 21	java/io/FileReader:<init>	(Ljava/lang/String;)V
    //   11: astore_1
    //   12: aload_1
    //   13: ifnull +32 -> 45
    //   16: new 23	java/io/BufferedReader
    //   19: dup
    //   20: aload_1
    //   21: sipush 1024
    //   24: invokespecial 26	java/io/BufferedReader:<init>	(Ljava/io/Reader;I)V
    //   27: astore_2
    //   28: aload_2
    //   29: invokevirtual 29	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   32: astore 10
    //   34: aload 10
    //   36: astore_0
    //   37: aload_2
    //   38: invokevirtual 32	java/io/BufferedReader:close	()V
    //   41: aload_1
    //   42: invokevirtual 33	java/io/FileReader:close	()V
    //   45: aload_0
    //   46: ifnull +16 -> 62
    //   49: aload_0
    //   50: iconst_1
    //   51: aload_0
    //   52: bipush 58
    //   54: invokevirtual 39	java/lang/String:indexOf	(I)I
    //   57: iadd
    //   58: invokevirtual 43	java/lang/String:substring	(I)Ljava/lang/String;
    //   61: astore_0
    //   62: aload_0
    //   63: invokevirtual 46	java/lang/String:trim	()Ljava/lang/String;
    //   66: areturn
    //   67: astore 7
    //   69: aconst_null
    //   70: astore 4
    //   72: aload 7
    //   74: astore 8
    //   76: getstatic 52	com/exchange/Public/ExchangeConstants:LOG_TAG	Ljava/lang/String;
    //   79: ldc 54
    //   81: aload 8
    //   83: invokestatic 60	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   86: pop
    //   87: aload 4
    //   89: astore_0
    //   90: goto -45 -> 45
    //   93: astore_3
    //   94: aconst_null
    //   95: astore 4
    //   97: aload_3
    //   98: astore 5
    //   100: getstatic 52	com/exchange/Public/ExchangeConstants:LOG_TAG	Ljava/lang/String;
    //   103: ldc 62
    //   105: aload 5
    //   107: invokestatic 60	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   110: pop
    //   111: aload 4
    //   113: astore_0
    //   114: goto -69 -> 45
    //   117: astore 12
    //   119: aload_0
    //   120: astore 4
    //   122: aload 12
    //   124: astore 5
    //   126: goto -26 -> 100
    //   129: astore 5
    //   131: goto -31 -> 100
    //   134: astore 11
    //   136: aload_0
    //   137: astore 4
    //   139: aload 11
    //   141: astore 8
    //   143: goto -67 -> 76
    //
    // Exception table:
    //   from	to	target	type
    //   16	34	67	java/io/IOException
    //   2	12	93	java/io/FileNotFoundException
    //   16	34	93	java/io/FileNotFoundException
    //   37	45	117	java/io/FileNotFoundException
    //   76	87	129	java/io/FileNotFoundException
    //   37	45	134	java/io/IOException
  }

  public static String a(Context paramContext)
  {
    if (ExchangeConstants.CHANNEL != null)
    {
      localObject1 = ExchangeConstants.CHANNEL;
      return localObject1;
    }
    Object localObject1 = "";
    try
    {
      ApplicationInfo localApplicationInfo = paramContext.getPackageManager().getApplicationInfo(paramContext.getPackageName(), 128);
      if ((localApplicationInfo != null) && (localApplicationInfo.metaData != null))
      {
        Object localObject2 = localApplicationInfo.metaData.get("UMENG_CHANNEL");
        if (localObject2 != null)
        {
          String str = localObject2.toString();
          if (str != null)
            localObject1 = str;
        }
      }
      ExchangeConstants.CHANNEL = (String)localObject1;
    }
    catch (Exception localException)
    {
      while (true)
        localException.printStackTrace();
    }
  }

  public static String a(Context paramContext, long paramLong)
  {
    String str;
    if (paramLong < 1000L)
      str = (int)paramLong + "B";
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return paramContext.getString(c.a(paramContext)) + ":" + str;
          if (paramLong >= 1000000L)
            break;
          str = Math.round((float)paramLong / 1000.0D) + "K";
        }
        if (paramLong >= 1000000000L)
          break;
        str = new DecimalFormat("#0.0").format((float)paramLong / 1000000.0D) + "M";
      }
      str = new DecimalFormat("#0.00").format((float)paramLong / 1000000000.0D) + "G";
    }
  }

  public static String a(String paramString)
  {
    String str;
    int i = 0;
    if (paramString == null)
    {
      str = null;
      return str;
    }
    try
    {
      byte[] arrayOfByte2;
      StringBuffer localStringBuffer;
      while (true)
      {
        byte[] arrayOfByte1 = paramString.getBytes();
        MessageDigest localMessageDigest = MessageDigest.getInstance("MD5");
        localMessageDigest.reset();
        localMessageDigest.update(arrayOfByte1);
        arrayOfByte2 = localMessageDigest.digest();
        localStringBuffer = new StringBuffer();
        if (i < arrayOfByte2.length)
          break;
        str = localStringBuffer.toString();
      }
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = Byte.valueOf(arrayOfByte2[i]);
      localStringBuffer.append(String.format("%02X", arrayOfObject));
      ++i;
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        str = paramString.replaceAll("[^[a-z][A-Z][0-9][.][_]]", "");
      }
    }
  }

  public static boolean a(Context paramContext, String paramString)
  {
    int i;
    if (paramContext.getPackageManager().checkPermission(paramString, paramContext.getPackageName()) != 0)
      i = 0;
    while (true)
    {
      return i;
      i = 1;
    }
  }

  public static String[] a(GL10 paramGL10)
  {
    String[] arrayOfString;
    try
    {
      arrayOfString = new String[2];
      String str1 = paramGL10.glGetString(7936);
      String str2 = paramGL10.glGetString(7937);
      arrayOfString[0] = str1;
      arrayOfString[1] = str2;
      return arrayOfString;
    }
    catch (Exception localException)
    {
      Log.e(ExchangeConstants.LOG_TAG, "Could not read gpu infor:", localException);
      arrayOfString = new String[0];
    }
  }

  public static void b(Context paramContext, String paramString)
  {
    paramContext.startActivity(paramContext.getPackageManager().getLaunchIntentForPackage(paramString));
  }

  public static boolean b(String paramString)
  {
    int i;
    if ((paramString != null) && (!(paramString.equals(""))))
      i = 0;
    while (true)
    {
      return i;
      i = 1;
    }
  }

  public static boolean c(Context paramContext, String paramString)
  {
    int i;
    try
    {
      paramContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(paramString)));
      i = 1;
      return i;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      i = 0;
    }
  }
}